//
//  ChartCell.m
//  SheShiDu
//
//  Created by 泉  姜 on 16/6/22.
//  Copyright © 2016年 单剑秋. All rights reserved.
//

#import "ChartCell.h"

#define HEIGHT self.contentView.frame.size.height
#define WIDTH self.contentView.frame.size.width
@implementation ChartCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imgView = [[UIImageView alloc] init];
//        _imgView.backgroundColor = [UIColor redColor];
        _imgView.clipsToBounds = YES;
        _imgView.layer.cornerRadius = 5;
        [self.contentView addSubview:_imgView];
        
        self.titleLabel = [[UILabel alloc] init];
//        _titleLabel.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_titleLabel];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _imgView.frame = CGRectMake(WIDTH * (5 / 375.0), HEIGHT * (10.0 / ((667 - 64 - 49) / 2)), WIDTH - WIDTH * (5 / 375.0) * 2, HEIGHT - HEIGHT * (10.0 / ((667 - 64 - 49) / 2)) *2 - HEIGHT * (20.0 / ((667 - 64 - 49) / 2)));
    _titleLabel.frame = CGRectMake(WIDTH * (20 / 375.0), HEIGHT - HEIGHT * (10.0 / ((667 - 64 - 49) / 2)) -  HEIGHT * (20.0 / ((667 - 64 - 49) / 2)), WIDTH * (150 / 375.0), HEIGHT * (20.0 / ((667 - 64 - 49) / 2)));
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
